package manager.server.factory{
	import flash.utils.ByteArray;

	public class ExitCommand extends SocketCommandBase implements ISocketCommand {
		private var _name:String;  //用户的名字

		public function ExitCommand(type:int = 0, name:String = ''){
			super.type = type;
			_name = name;
			write();
		}

		/**实现数据写入**/
		override public function write():void {
			super.write();
			byteArray.writeUTF(_name);
		}

		/**按类型接收到数据并进行解码操作**/
		override public function decodeSocketData(byteArray:ByteArray):ISocketCommand {
			super.decodeSocketData(byteArray);
			_name = byteArray.readUTF();
			return this;
		}
		
		public function get name():String {
			return _name;
		}
		
		public function set name(value:String):void {
			_name = value;
		}
	}
}